import { useResponseSuccess } from '~/utils/response';

export default eventHandler(async (event) => {
  const templateId = getRouterParam(event, 'id');
  const body = await readBody(event);
  const { resourceIds } = body;

  // 模拟应用模板到资源
  return useResponseSuccess({
    message: '应用模板成功',
    data: {
      templateId,
      resourceIds,
      appliedCount: resourceIds.length,
      appliedTime: new Date().toISOString().replace('T', ' ').substring(0, 19),
    },
  });
});
